﻿Public Class _Default
    Inherits System.Web.UI.Page


    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles btnAra.Click

        If IsNumeric(tbTakipNo.Text) Then

            Dim detay = Sorgula("select gonderenTC, urunTuru, faturaTuru, alinmatarihi, teslimtarihi, gonderen.Adi as gonderensube,alici.Adi as alicisube from kargolar " +
                " left join merkezlersubeler as alici on (kargolar.aliciSube = alici.ID) " +
                " left join merkezlersubeler as gonderen on (kargolar.gonderenSube = gonderen.ID) " +
                " where kargoID = " + tbTakipNo.Text)


            dvDetay.DataSource = detay
            dvDetay.DataBind()

            Dim dokum = Sorgula("select islemID, tarih,gonderen.Adi as gonderensube,  alici.Adi as alicisube, islem from kargorotaislemleri " +
                    "left join merkezlersubeler as alici on (kargorotaislemleri.hedefsubeID = alici.ID)" +
                    "left join merkezlersubeler as gonderen on (kargorotaislemleri.kaynaksubeID = gonderen.ID)" +
                    "where kargoID = " + tbTakipNo.Text)
            gvDokum.DataSource = dokum
            gvDokum.DataBind()
        End If

    End Sub
End Class